package eu.jpereira.trainings.designpatterns.creational.abstractfactory;

import eu.jpereira.trainings.designpatterns.creational.abstractfactory.Report;
import eu.jpereira.trainings.designpatterns.creational.abstractfactory.json.JSONReportBody;
import eu.jpereira.trainings.designpatterns.creational.abstractfactory.json.JSONReportFooter;
import eu.jpereira.trainings.designpatterns.creational.abstractfactory.json.JSONReportHeader;
import eu.jpereira.trainings.designpatterns.creational.abstractfactory.xml.XMLReportBody;
import eu.jpereira.trainings.designpatterns.creational.abstractfactory.xml.XMLReportFooter;
import eu.jpereira.trainings.designpatterns.creational.abstractfactory.xml.XMLReportHeader;



public abstract class ReportFactory{
	
	

	public static ReportBody generateBody(String reportType) {
		ReportBody body;
		if ( reportType.equals("JSON")) {
			
			body = new JSONReportBody();
			//return body;
			/*setBody(new JSONReportBody());		
			setFooter(new JSONReportFooter());
			setHeader(new JSONReportHeader());*/
		} else {
			/*setFooter(new XMLReportFooter());
			setHeader(new XMLReportHeader());*/
			body = new XMLReportBody();	
		}
		return body;
	}
	public static ReportFooter generateFooter(String reportType) {
		ReportFooter footer;
		if ( reportType.equals("JSON")) {
			
			footer = new JSONReportFooter();
			//return body;
			/*setBody(new JSONReportBody());		
			setFooter(new JSONReportFooter());
			setHeader(new JSONReportHeader());*/
		} else {
			/*setFooter(new XMLReportFooter());
			setHeader(new XMLReportHeader());*/
			footer = new XMLReportFooter();	
		}
		return footer;
	}
	public static ReportHeader generateHeader(String reportType) {
		ReportHeader header;
		if ( reportType.equals("JSON")) {
			
			header = new JSONReportHeader();
			//return body;
			/*setBody(new JSONReportBody());		
			setFooter(new JSONReportFooter());
			setHeader(new JSONReportHeader());*/
		} else {
			/*setFooter(new XMLReportFooter());
			setHeader(new XMLReportHeader());*/
			header = new XMLReportHeader();	
		}
		return header;
	}
}
